<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:template match="/">
    <html>
      <head>
        <a href="./index.html">Início</a> -
        <a href="./controleAdministrativo.html">Controle Administrativo</a>
        <title>
          Cadastro de Funcionários
        </title>
        <style>
          body, td, th { font-family:Verdana, Arial, helvetica, sans-serif; font-size:x-small; }
        </style>
      </head>
      <body STYLE=" background-color:#EEEEEE">
       	<center>
          <h1>Listagem de Funcionários</h1>    
        </center>
        <table border="0" bgcolor="#CC9933">
        <tr>
        	<td valign="top" ><b>Nome</b></td>
        	<td valign="top" ><b>CPF</b></td>
        	<td valign="top" ><b>Detalhe</b></td>
        	<td valign="top" ><b>Remover</b></td>
        	<td valign="top" ><b>Editar</b></td>
		</tr>
        <xsl:apply-templates select="funcionarios/funcionario"/>
        <td valign="top"><a href="funcionarios.do?methodToCall=formFuncionario">Inserir novo funcionário</a></td>
        </table>
      </body>
    </html>
  </xsl:template>

  <!-- Displays list of play's characters -->
  <xsl:template match="funcionario">
      <tr bgcolor="#FFCC66">
        <td valign="top" ><xsl:value-of select="nome"/></td>
        <td valign="top" ><xsl:value-of select="cpf"/></td>
        <td align="center" >
        	<a>
        		<xsl:attribute name="href">funcionarios.do?methodToCall=detalhar&amp;cpf=<xsl:value-of select="cpf"/></xsl:attribute>
				<img border="0" src="_img/view.png"/>
			</a>
		</td>
        <td align="center" >
			<a>
        		<xsl:attribute name="href">funcionarios.do?methodToCall=remover&amp;cpf=<xsl:value-of select="cpf"/></xsl:attribute>
				<img border="0" src="_img/cancel.png"/>
			</a>        
        </td>
        <td align="center" >
			<a>
        		<xsl:attribute name="href">funcionarios.do?methodToCall=formAlterar&amp;cpf=<xsl:value-of select="cpf"/>&amp;nome=<xsl:value-of select="nome"/></xsl:attribute>
				<img border="0" src="_img/edit.png"/>
			</a>        
        </td>
      </tr>
  </xsl:template>

 
</xsl:stylesheet>
